using System;
using System.Collections;
using System.Reflection;

namespace UnityEngine
{
#if ENABLE_MONO || UNITY_WP8
internal class SetupCoroutine
{
	static public object InvokeMember (object behaviour, string name, object variable)
	{
		object[] args = null;
		if (variable != null)
		{
			args = new System.Object[1];
			args[0] = variable;
		}
			
		return behaviour.GetType ().InvokeMember (name, BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, behaviour, args, null, null, null);
	}

	static public object InvokeStatic (Type klass, string name, object variable)
	{
		object[] args = null;
		if (variable != null)
		{
			args = new System.Object[1];
			args[0] = variable;
		}

		return klass.InvokeMember (name, BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, null, null, args, null, null, null);
	}

}
#endif
}
